<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>    
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 
<base href="<%=basePath%>"> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="http://www.bootcss.com/p/layoutit/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="http://www.bootcss.com/p/layoutit/css/layoutit.css" rel="stylesheet">
<!-- <script type="text/javascript" src="jquery1.8/jquery-1.8.0.js"></script> -->
<script type="text/javascript" src="jquery1.8/jquery.js"></script>
<title>复审页面</title>
<style>
#login1{  
        display:none;  
        border:1em solid pink;  
        height:50%;  
        width:50%;  
        position:absolute;/*让节点脱离文档流,我的理解就是,从页面上浮出来,不再按照文档其它内容布局*/  
        top:24%;/*节点脱离了文档流,如果设置位置需要用top和left,right,bottom定位*/  
        left:24%;  
        z-index:2;/*个人理解为层级关系,由于这个节点要在顶部显示,所以这个值比其余节点的都大*/  
       /*  background: lightgrey;   */
        border: 1px solid; 
	  }  
#over1{  
		 width: 100%;  
		 height:100%;  
		 opacity:0.8;/*设置背景色透明度,1为完全不透明,IE需要使用filter:alpha(opacity=80);*/  
		 filter:alpha(opacity=80);  
		 display: none;  
		 position:absolute;  
		 top:0;  
		 left:0;  
		 z-index:1;  
		 background: lightgrey;
		 border: 1px solid; 
		 } 
#login {  
	        display:none;  
	        border:0em solid pink;  
	        height:50%;  
	        width:50%;  
	        position:absolute;/*让节点脱离文档流,我的理解就是,从页面上浮出来,不再按照文档其它内容布局*/  
	        top:24%;/*节点脱离了文档流,如果设置位置需要用top和left,right,bottom定位*/  
	        left:24%;  
	        z-index:2;/*个人理解为层级关系,由于这个节点要在顶部显示,所以这个值比其余节点的都大*/  
	       /*  background: lightgrey;   */
	        border: 0px solid; 
	    }  
#over{  
		 width: 100%;  
		 height:100%;  
		 opacity:0.8;/*设置背景色透明度,1为完全不透明,IE需要使用filter:alpha(opacity=80);*/  
		 filter:alpha(opacity=80);  
		 display: none;  
		 position:absolute;  
		 top:0;  
		 left:0;  
		 z-index:1;  
		 background: lightgrey;
	} 
	.logo{
		background-image:url(images/hyd_logo.png);
		background-repeat:repeat-y;
		border:1px solid black;
		background-color: gray;
		width:100%;
		height:80px;
		margin:auto;
	}
	.logo h1{
		color:white;
		position:absolute; 
		font-size:30px;
		margin-left: 180px;
		margin-top: 5px;
	}
	.logo button{
		color: red;
		width:80px;
		height:30px;
		font-size:18px;
		font-weight:bold;
		float:right;
		margin-top: 45px;
	}
	.demo{
		border:2px solid green;
		width:100%;
		height: 590px;
		
	}
	.demo01{
		width:150px;
		height:590px;
		background-color:highlight;
		border:1px solid gray;
		float: left;
	}
 	.leixin{
		font-size: 18px;
		margin: 35px auto;	
	} 
 	a{	
		text-decoration:none;
		color:brown;
		font-weight: bold;
	}
 	.demo02{
		width:1420px;
		height: 590px;
		border:1px solid red;
		margin-left: 155px;
	}

 	.banquan{
		width: 100%;
		height: 70px;
		background-color: gray;
		border:1px solid black;
		
	}
	.banquan p{
		text-align: center;
		font-size: 16px;
		margin-top: 2px;
	} 
	td{
		text-align: center;
		color:maroon;
		font-weight: bold;
	}
	tr{
		line-height: 25px;
	} 
	#img{
		border:0px solid red;
		width: 600px;
		height: 500px;
		margin-left: 720px;
		margin-top: -540px;
	}
	.yema{
		border:0px solid red;
		width: 400px;
		height: 20px;
		margin: auto;
		margin-top: 30px;
		color: brown;
		font-weight: bold;
	}
	#login1{
		width: 627px;
		height: 500px;
		border: 1px solid;
		z-index:999;
		overflow-y:auto;
		background-color:gray;
		position:fixed; left:350px; top:50px;
	}
	.input {   
		 margin:0;   
		 padding:0;   
		 height:29px;   
		 width:404px;
		 } 
</style>
<script type="text/javascript">
function zx(){
	alert("查征信");
	var realname = $("#realname").html();//姓名
	var idcard = $("#idcard").html();//身份证
//	realname="李尚钟";
//	idcard="532722197511040914";
	alert(realname+idcard);
	$.ajax({
		data:"realname="+realname+"&idcard="+idcard,
		type:"post",
		url:"ApplyAction/zxjk.do",
		dataType:"json",
		cache:false,
		success:function (zxList){
			alert(zxList.length);
			if(zxList.length==0){//表示没有失信记录
				alert("信用良好");
			}else{
				var html="<tr><td>名字</td><td>年龄</td><td>性别</td><td>身份证</td><td>申请日期</td><td>案号</td><td>履行能力</td><td>备注</td></tr>";
				for(var i=0;i<zxList.length;i++){
					var obj=zxList[i];
					html+="<tr><td>"+obj.realname+"</td><td>"+obj.age+"</td><td>"+obj.sex+"</td><td>"+obj.idcard+"</td><td>"+obj.filingdate+"</td><td>"+obj.caseno+"</td><td>"+obj.performance+"</td><td>"+obj.description+"</td></tr>";
				}
				var bt = "<tr><td><input onclick='off()' type='button' value='关闭' /></td></tr>";
				html=html+bt;
				alert(html);
				$("#mytab").html(html);
				$("#login1").css("display","block");
			}
		},
		error:function(){
			alert("请求失败");
		}
	});
}

//查身份证的真是度
function sfz(){
	alert("查身份证");
	var realname = $("#realname").html();//姓名
	var idcard = $("#idcard").html();//身份证
//	realname="李尚钟";
//	idcard="532722197511040914";
	alert(realname+idcard);
	$.ajax({
		data:"realname="+realname+"&idcard="+idcard,
		type:"post",
		url:"sfz.do",
		dataType:"json",
		cache:false,
		success:function (data){
			if(data.mesg=="true"){//表示身份证号码与名字一致
				alert("身份证与名字一致");
			}else{
				alert("身份证与名字   不   一致");
			}
		},
		error:function(){
			alert("请求失败");
		}
	});
}
</script>
</head>
<body>
	<!-- logo区 -->
	<div class="logo" >	
		<h1>好易贷复审管理系统</h1>
		<button>退出</button>
	</div>
	<!-- 内容区 -->
	<div class="demo" >
		<!-- 模块1区 -->
		<div class="demo01">
			<ul class="type">
				<li class="leixin"><a href="<%=basePath%>ApplyAction/sss.do">信用贷款</a></li>
<!-- 				<li class="leixin"><a href="fuShen02.jsp">抵押贷款</a></li>	 -->
				<li class="leixin"><a href="<%=basePath%>Business/gsfs.do">公司贷款</a></li>
			</ul>
		</div>
		<!-- 模块2区 -->
		<div class="demo02">
			<p style="color:brown;font-weight: bold;font-family: cursive;font-size: 20px;margin-top: -1px">信用贷款用户</p>
			
			<table border="1" bordercolor="brown" style="margin-left: 50px;" id="zhengxin">
				<c:forEach items="${appList }" var="appList" varStatus="st">
					<tr>
						<td width="150px">编号</td><td width="400px">${st.index+1 }</td>
					</tr>
					<tr>
						<td>单号</td><td>${appList.pay_num }</td>
					</tr>
					<tr>
						<td>姓名</td><td><span id="realname">${appList.app_name }</span><button style="float:right" class="btn btn-warning" onclick="zx()">查看征信</button></td>
					</tr>
					<tr>
						<td>电话</td><td>${appList.app_phone }</td>
					</tr>
					<tr><!-- 相当于一个td里面包含一个span标签 和其他标签哦  还有个按钮嗯重启 -->
						<td>身份证</td><td><span id="idcard">${appList.idcard_num }</span><button style="float:right" onclick="sfz()">身份证真实性</button></td>
					</tr>
					<tr>
						<td>银行卡号</td><td>${appList.bank_num }<button style="float:right" class="btn btn-warning" type="button" onclick="show()">查看银行流水</button></td>
					</tr>
					<div id="login">
						<div style="height:360px;">
							<form action="" method="post" id="update">
								   <img src="images/liushui.jpg" width="360px" height="352px">
						    </form>
							<a href="javascript:hide()">关闭</a>  
						 </div>  
					</div>
					<tr>
						<td>现居地址</td><td>${appList.app_address }</td>
					</tr>
					<tr>
						<td>贷款金额</td><td>${appList.daik_money }</td>
					</tr>
					<tr>
						<td>贷款用途</td><td>${appList.daik_use }</td>
					</tr>
					<tr>
						<td>婚姻状况</td><td>${appList.mar_state }</td>
					</tr>
					<tr>
						<td>公司名称</td><td>${appList.company_name }</td>
					</tr>
					<tr>
						<td>紧急联系人</td><td>${appList.con_name }</td>
					</tr>
					<tr>
						<td>紧急联系人电话</td><td>${appList.con_phone }</td>
					</tr>
					<tr>
						<td>贷款类型</td><td>${appList.fenqi.tname }</td>
					</tr>
					<tr>
						<td>贷款期数</td><td>${appList.fenqi.fname }</td>
					</tr>
					<tr>
						<td>审批意见:</td><td><input class="input" name="sur_content"></td>
					</tr>
					<tr>
						<td height="35px;">审核意见</td><td><input type="button" onclick="ok('${appList.pay_num }')" style="width: 100px;height: 30px;color:green;font-size: 17px;font-weight: bold;" value="通过" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onclick="bohui('${appList.pay_num }')"  style="width: 100px;height: 30px;color:red;font-size: 17px;font-weight: bold;"value="不通过" /></td>
					</tr>
				</table>
				<div id="img">
					<table border="1" bordercolor="green" >
					
					<tr>
						<td colspan="2" height="35px">身份证正反面</td>
					</tr>
					<tr>
						<td width="290px" height="160px"><img src="http://192.168.1.115:666/img/642326b3-30fa-47b3-9de4-1431fd9283b9.png" width="288px" height="158px"></td><td width="290px" height="160px"><img src="http://192.168.1.115:666/img/abeb7fe8-44c4-470f-960d-6387b2ad1ad9.jpg" width="288px" height="158px"></td>
					</tr>
					<tr>
						<td colspan="2" height="35px">银行卡正反面</td>
					</tr>
					<tr>
						<td width="290px" height="160px"><img src="http://192.168.1.115:666/img/0b5d0a79-5884-4198-aeaf-52b109f1c94b.jpg" width="288px" height="158px"></td><td width="290px" height="160px"><img src="http://192.168.1.115:666/img/7da870e2-9efe-4d80-8713-c9d759d2a122.jpg" width="288px" height="158px"></td>
					</tr>
				</c:forEach>
			</table>
			<div class="yema">
				&nbsp;&nbsp;
				<a href="javascript:firstPage()">首页</a>
				&nbsp;&nbsp;
				<a href="javascript:upPage()">上一页</a>
				&nbsp;&nbsp;
				<a href="javascript:nextPage()">下一页</a>
				&nbsp;&nbsp;
				<a href="javascript:lasPage()">尾页</a>
				&nbsp;&nbsp;&nbsp;
				当前是第${pageUtil.pageNum }/${pageUtil.totalPage }页,一共有${pageUtil.totalNum }条数据<br/>
			</div>
			
			<div>
					<form action="<%=basePath%>ApplyAction/sss.do" method="post" id="pageForm">
						<input type="hidden" id="pageNum" value="${pageUtil.pageNum }" name="pageNum"/>
						<input type="hidden" id="totalPage" value="${pageUtil.totalPage }"/>
					</form>	
				</div>
		</div>
			
		</div>
	</div>
	<!-- 版权区 -->
	<div class="banquan">
		<p>版权所有，盗版必究</p>
		<p>http://www.zhiling.com</p>
	</div>
	<div id="login1" style="display: none;">
		<form action=""  method="post">
			<table id="mytab" border="1" cellpadding="0" cellspacing="0">
				<tr><td><input onclick="off()" type="button" value="关闭" /></td></tr>
			</table>
		</form>
	</div>
	<script type="text/javascript">
	/* 银行卡流水图  */
	var login = document.getElementById('login');  
	var over = document.getElementById('over');  
	    function show()  
	    {  
	        login.style.display = "block";  
	        over.style.display = "block";
 		<%--   /* location.href="<%=basePath%>userById.do?u_id=${userInfo.u_id}";*/ --%>
 	    }  
	    function hide()  
	    {  
	        login.style.display = "none";  
	        over.style.display = "none";  
	    }  
	    /* 征信接口弹窗  */
	    var login1 = document.getElementById('login1');  
		var over1 = document.getElementById('over1');  
		    function show1()  
		    {  
		        login1.style.display = "block";  
		        over1.style.display = "block";
	 		<%--   /* location.href="<%=basePath%>userById.do?u_id=${userInfo.u_id}";*/ --%>
	 	    }  
		    function hide1()  
		    {  
		        login1.style.display = "none";  
		        over1.style.display = "none";  
		    }  
</script>
</body>
	<script type="text/javascript">
		
		function firstPage(){
			document.getElementById("pageNum").value=1;
			document.getElementById("pageForm").submit();
		}
		function upPage(){
			var pageNum = document.getElementById("pageNum").value;
			pageNum = parseInt(pageNum);
			if(pageNum <= 1){
				alert("当前已经是第一页了");
			}
			else{
				pageNum = pageNum - 1;
				document.getElementById("pageNum").value=pageNum;
				document.getElementById("pageForm").submit();
			}
		}
		function nextPage(){
			var pageNum = document.getElementById("pageNum").value;
			var totalPage = document.getElementById("totalPage").value;
			pageNum = parseInt(pageNum);
			totalPage = parseInt(totalPage);
			if(pageNum >= totalPage){
				alert("当前已经是最后一页了");
			}
			else{
				pageNum = pageNum + 1;
				document.getElementById("pageNum").value=pageNum;
				document.getElementById("pageForm").submit();
			}
			
		}
		function lasPage()
		{
			var totalPage = document.getElementById("totalPage").value;
			document.getElementById("pageNum").value=totalPage;
			document.getElementById("pageForm").submit();
		}
	</script>
	<script type="text/javascript">
		function off() {
			$("#login1").css("display","none");
		}
		 //驳回
		function bohui(a){
			location.href="<%=basePath%>ApplyAction/noApplyFs.do?pay_num="+a;
			alert("审核已驳回!");
		}
		//通过
		function ok(a){
			location.href="<%=basePath%>ApplyAction/OKApplyFs.do?pay_num="+a;
			alert("审核已通过!");
		}
	</script>
</body>
</html>